using GEM.Application.Common;
using GEM.Application.Dto;
using GEM.Application.Dto.User;

namespace GEM.Application.Repositories;

public interface IUserService
{

    /// <summary>
    /// 分页查询用户
    /// </summary>
    /// <param name="pageIndex">页码</param>
    /// <param name="pageSize">每页条数</param>
    /// <returns>分页数据</returns>
    Task<PagedResult<UserDto>> GetUserPagedAsync(int pageIndex, int pageSize);

    // Task<IEnumerable<UserDto>> GetUserListAsync();
    Task<dynamic> GetByIdAsync(Guid id);
    Task<int> UserUpdateAsync(Guid id, UserDto userDto);
    //软删除
    Task<dynamic> DeleteByIdAsync(Guid id);
    Task<dynamic> DeletedByIdAsync(Guid id);
    //启用用户
    Task<dynamic> EnableUserAsync(Guid id);
    //禁用用户
    Task<dynamic> DisableUserAsync(Guid id);
    Task<dynamic> ChangePasswordAsync(Guid id, string oldPwd, string newPwd);

    /// <summary>
    /// 分配角色
    /// </summary>
    /// <param name="userId"></param>
    /// <param name="roleId"></param>
    /// <returns></returns>
    Task<dynamic> AssignRoleAsync(Guid userId, Guid roleId);

    Task<dynamic> RemoveRoleAsync(Guid userId, Guid roleId);

    /// <summary>
    /// 为指定用户修改昵称
    /// </summary>
    Task<dynamic> ChangeNicknameAsync(Guid userId, string nickname);

    /// <summary>
    /// 为指定用户修改头像
    /// </summary>
    Task<dynamic> ChangeAvatarUrlAsync(Guid userId, string avartarUrl);

    /// <summary>
    /// 为指定用户修改邮箱
    /// </summary>
    Task<dynamic> ChangeEmailAsync(Guid userId, string email);

    /// <summary>
    /// 修改指定用户的所有基本信息
    /// </summary>
    Task<dynamic> ChangeUserAsync(Guid userId, ChangeUserDto changeUserDto);

}